package cn.ickck.law_paper_final.service.Impl;

import cn.ickck.law_paper_final.mapper.GdbBatchDAO;
import cn.ickck.law_paper_final.mapper.GdbBatchMapper;
import cn.ickck.law_paper_final.model.entity.GdbBatch;
import cn.ickck.law_paper_final.service.GdbBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: ck
 * @Description:
 * @Date: Create in 15:57 2020/11/28
 */
@Service
public class GdbBatchServiceImpl implements GdbBatchService {
   @Autowired
   private GdbBatchMapper gdbBatchMapper;
   @Autowired
   private GdbBatchDAO gdbBatchDAO;
    @Override
    public Integer insert(GdbBatch gdbBatch) {
        return gdbBatchMapper.insert(gdbBatch);
    }

    @Override
    public int count() {
        return gdbBatchMapper.count();
    }


    @Override
    public List<GdbBatch> selectByPage(int start, int end) {
        return gdbBatchMapper.selectByPage(start,end);
    }


    @Override
    public List<GdbBatch> findBatchByName(String name) {
        return gdbBatchMapper.findByName(name);
    }


    @Override
    public Integer deleteById(Integer id) {
        return gdbBatchMapper.delete(id);
    }

    @Override
    public String findKeyById(Integer id) {
        return gdbBatchMapper.findKeyById(id);
    }

    @Override
    public void update(GdbBatch gdbBatch) {
        gdbBatchDAO.updateByPrimaryKeySelective(gdbBatch);
    }
}
